from fastapi import APIRouter, BackgroundTasks

from src.utils.command import execute_shell_simple
from src.utils.rs import Rs

router = APIRouter(prefix="/task")


@router.get("/create", response_model=Rs)
async def create(background_tasks: BackgroundTasks):
    background_tasks.add_task(execute_shell_simple, "python --version")
    return Rs().ok(data="任务已创建")
